#include "stm32f10x.h"
#include "FreeRTOS.h"
#include "Task.h"
#include "all_header.h"



TaskHandle_t myTaskHandler;

int16_t ax,ay,az,gx,gy,gz;
void mytask(void *arg)
{
	while (1)
	{
		mpu6050_getdata(&ax,&ay,&az,&gx,&gy,&gz);
		
		OLED_ShowSignedNum(1,1,ax,5);
		OLED_ShowSignedNum(1,8,ay,5);
		OLED_ShowSignedNum(2,1,az,5);
		OLED_ShowSignedNum(2,8,gx,5);
		OLED_ShowSignedNum(3,1,gy,5);
		OLED_ShowSignedNum(3,8,gz,5);
		
	}
}


int main(void)
{
	OLED_Init();
	mpu6050_init();
	
	xTaskCreate(mytask,"myTask",128,NULL,2,&myTaskHandler);
	vTaskStartScheduler();
	
	while(1);
	
}
